﻿#include "factory.h"

#include <QDebug>

#include "concreteproducta.h"
#include "concreteproductb.h"

Factory::Factory()
{

}

AbstractProduct *Factory::createProduct(QString name)
{
    AbstractProduct* product = Q_NULLPTR;
    if (name == "A")
        product = new ConcreteProductA();
    else if (name == "B")
        product = new ConcreteProductB();
    else
        qDebug() << "unkown";
    return product;
}
